#!/bin/bash
dt=`date -d '1 days ago' '+%Y-%m-%d'`
nohup hive -hivevar etl_dt="$dt" -f /hive_ods_dwd/inc_add.sql & > /hive_ods_dwd/full_add.log
nohup hive -hivevar etl_dt="$dt" -f /hive_ods_dwd/full_add.sql & > /hive_ods_dwd/full_add.log
if test $? -ne 0
then
	# 运行失败则退出
	echo "ODS-DWD 增量报错"
	exit
fi
nohup hive -hivevar etl_dt="$dt" -f /hive_dwd_dws/inc_add.sql & > /hive_dwd_dws/inc_add.log
if test $? -ne 0
then
	# 运行失败则退出
	echo "DWD-DWS 增量报错"
	exit
fi
nohup hive -hivevar etl_dt="$dt" -f /hive_dws_ads/inc_add.sql & > /hive_dws_ads/inc_add.log
if test $? -ne 0
then
	# 运行失败则退出
	echo "DWS-ADS 增量报错"
	exit
fi